/**
 * pharma-model - 9 janv. 2011 guillaume
 */
package org.bspv.pharma.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Version;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.bspv.pharma.common.constant.Constants;

/**
 * @author guillaume
 */
@Entity
@Table(name = "TYPE_OF_SUPPLY")
public class TypeOfSupply implements Serializable {

    /**
     * serialVersionUID.
     */
    private static final long serialVersionUID = 2332627198790886983L;

    /**
     * Identifiant du type de fourniture.
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    /**
     * Libellé du type de fourniture.
     */
    @NotNull
    @Size(max = Constants.CONSTRAINT_LABEL_SIZE)
    private String label;
    /**
     * Description du type de fourniture.
     */
    @Size(max = Constants.CONSTRAINT_DESCRIPTION_SIZE)
    private String description;
    /**
     * Date à partir de laquelle ce type de fourniture est déprécié.
     */
    private Date deprecated;
    /**
     * Date à partir de laquelle ce type de fourniture est obsolete.
     */
    private Date obsolete;
    /**
     * Catégorie de ce type de fourniture.
     */
    @ManyToOne
    private Category category;
    /**
     * Conditionnement.
     */
    @ManyToOne
    private Packaging packaging;
    /**
     * Pharmacie où commander ce type de fourniture.
     */
    @NotNull
    @ManyToOne
    private Drugstore drugstore;
    /**
     * Quota.
     */
    @NotNull
    private Integer quota;
    /**
     * Commentaire.
     */
    @Size(max = Constants.CONSTRAINT_COMMENT_SIZE)
    private String comment;
    /**
     * Numéro de version.
     */
    @Version
    private Integer version;

    /**
     * @return the id
     */
    public final Long getId() {
        return id;
    }

    /**
     * @param id
     *            the id to set
     */
    public final void setId(final Long id) {
        this.id = id;
    }

    /**
     * @return the label
     */
    public final String getLabel() {
        return label;
    }

    /**
     * @param label
     *            the label to set
     */
    public final void setLabel(final String label) {
        this.label = label;
    }

    /**
     * @return the description
     */
    public final String getDescription() {
        return description;
    }

    /**
     * @param description
     *            the description to set
     */
    public final void setDescription(final String description) {
        this.description = description;
    }

    /**
     * @return the deprecated
     */
    public final Date getDeprecated() {
        return deprecated;
    }

    /**
     * @param deprecated
     *            the deprecated to set
     */
    public final void setDeprecated(final Date deprecated) {
        this.deprecated = deprecated;
    }

    /**
     * @return the obsolete
     */
    public final Date getObsolete() {
        return obsolete;
    }

    /**
     * @param obsolete
     *            the obsolete to set
     */
    public final void setObsolete(final Date obsolete) {
        this.obsolete = obsolete;
    }

    /**
     * @return the category
     */
    public final Category getCategory() {
        return category;
    }

    /**
     * @param category
     *            the category to set
     */
    public final void setCategory(final Category category) {
        this.category = category;
    }

    /**
     * @return the packaging
     */
    public final Packaging getPackaging() {
        return packaging;
    }

    /**
     * @param packaging
     *            the packaging to set
     */
    public final void setPackaging(final Packaging packaging) {
        this.packaging = packaging;
    }

    /**
     * @return the drugstore
     */
    public final Drugstore getDrugstore() {
        return drugstore;
    }

    /**
     * @param drugstore
     *            the drugstore to set
     */
    public final void setDrugstore(final Drugstore drugstore) {
        this.drugstore = drugstore;
    }

    /**
     * @return the quota
     */
    public final Integer getQuota() {
        return quota;
    }

    /**
     * @param quota
     *            the quota to set
     */
    public final void setQuota(final Integer quota) {
        this.quota = quota;
    }

    /**
     * @return the comment
     */
    public final String getComment() {
        return comment;
    }

    /**
     * @param comment
     *            the comment to set
     */
    public final void setComment(final String comment) {
        this.comment = comment;
    }

    /**
     * @return the version
     */
    public final Integer getVersion() {
        return version;
    }

    /**
     * @param version
     *            the version to set
     */
    public final void setVersion(final Integer version) {
        this.version = version;
    }

}
